import React, { Component } from 'react';
import {
    View,
    Text,
    ListView,
    TouchableOpacity,                 //底部刷新小组件
} from 'react-native';
import { Cbenefitsbody_Style as styles } from '../../../../styles';
const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => { r1 !== r2 } });//listView 数据判断方式
export default class Benefits_list extends Component {
    // 初始化模拟数据
    constructor(props) {
        super(props);
    }
    render() {
        //创建listView数据源
        let dataSource = [];
        if (this.props.list == undefined) {
            dataSource = ds.cloneWithRows([]);
        } else {
            dataSource = ds.cloneWithRows(this.props.list);
        }
        return (
            <View style={{ flex: 1 }}>
                <ListView
                    dataSource={dataSource}
                    renderRow={this.renderRow.bind(this)}
                    contentContainerStyle={styles.skill_view}
                    enableEmptySections={true}
                />
            </View>
        );
    }

    renderRow(rowData) {
        return (
            <TouchableOpacity style={styles.skill_out}
                onPress={() => {
                    this.props.deleHY(rowData.welfareName);
                }}>
                <Text style={styles.tradetext2}>
                    {rowData.welfareName}
                </Text>
            </TouchableOpacity>
        )
    }
}